1. Field of the Invention
This invention relates to processing an image, comprising an image header and image data, in a single-application environment, by emulating a multi-processing environment. In particular, this invention relates to an object-oriented system employing a library of predefined objects or data structures which can be linked between a host application and a data source or between a host application and a data user to create a stream-oriented data processing structure emulating a UNIX.RTM.-like pipeline data structure.
2. Description of the Related Art
The use of data processing pipelines in true multi-processing environments is well known. Examples of known multi-processing environments include both multiple-processor systems and high level systems where a single processor is able to support true multi-processing. The UNIX.RTM. operating system is often used in such multi-processing systems.
In such multi-processing environments, data processing pipelines are extremely useful for processing large, highly structured data blocks, such as those associated with image processing, database processing, or spreadsheet processing. Such data blocks typically include a header and one or more lines, or sets, of data. The header indicates the type of data, its characteristics, and how many sets of data are in the data block. When working with such data blocks, various data processing operations must be performed on each set of data in the data blocks before the data can be used by a host application. Further, the various data processing operations are performed in a specific order.
In a multi-processing environment, data processing pipelines provide a very efficient method for processing the data blocks. In these data processing pipelines, each separate data processing operation is defined as a section of the pipeline. Each section is linked to one or both of the sections (the upstream and downstream sections) to which it is adjacent. The data processing pipeline thus forms a chain of linked pipeline sections between a data source or between a host application and a data user and a host application. In a computer having a number of independent processors, each pipeline section corresponds to one of the processors. In this case, each processor works independently, and the computer operating system controls the flow of data between processors and the memory allocation. While this efficiently processes the data, the overhead necessary to control the processors and the memory consumes a significant proportion of the system's resources.
Likewise, in a computer having a single processor which can simultaneously run a number of different independent processing operations, or processes, each pipeline section corresponds to one of the independently-running processes. In this case, the operating system allocates the run-time of each process, the flow of data between each process and memory and the memory allocation. The overhead necessary to control the computer in this case consumes an even larger proportion of the system's resources, as each process and its data must be swapped into and out of the processor each time it is run. Additionally, because the processes communicate through the operating system, dynamically altering the pipeline is difficult, if not impossible.
In general, the source of data for the pipeline could include a spreadsheet providing financial information; the records within a database file providing database information; image data generated by a conventional image scanner from an original document; and a computer generated image. The host application could be a graphics program for producing pie charts, bar charts or the like from processed financial data; an inventory, accounting, or merging program which uses processed database data; or an image forming apparatus for forming an image from the processed image data.
Regardless of the particular source of data, or ultimate host application, the first, or upstream-most, section of the data processing pipeline is generally the data source for the pipeline. Alternately, the data source for this first pipeline can be a second pipeline. In this case, a special branching or "fan-out" pipeline section of the second pipeline can be used to supply data to both the first pipeline and the downstream sections of the second pipeline. In either case, the first pipeline section obtains a data element for the pipeline from the source of data and makes the data element available to the immediately downstream, or second, pipeline section. The second pipeline section receives the data element from the first pipeline section, processes the data element, and passes it downstream to the next immediately downstream or third pipeline section.
In a true multi-processing environment, the first pipeline section would obtain the next data element from the source of data and output it to the second pipeline section while the second pipeline section processes the data element received from the first pipeline section and outputs it to the third pipeline section. Accordingly, as each data element is processed by one of the pipeline sections, it is output to the next downstream section until it is output to the host application. The data can be efficiently and quickly processed in the multiprocessing environment by associating one processing operation, or processor, with each section of the pipeline. This ensures that the pipeline is able to process the data block with the data through-put being limited only by the least efficient pipeline section, and the inefficiencies caused by the overhead.
In contrast, in a single-processing environment, although a variety of methods for processing large data blocks are available, each of them is inefficient compared to a multi-processing system. For example, in one method, each data processing operation is applied to every data element of a data block before any other data processing operation is applied to any data element of the data block. That is, every element of the data block must be subjected to a first data processing operation before any elements are subjected to a second data processing operation. The efficiency of the data processing operation in a single-processing environment is proportional to the efficiency of each data processing operation.
Because data elements continually move from one data processing section of a pipeline to another in a multi-processing environment, and because the data processing commands must be continuously swapped into and out of the active memory of the system, the system overhead required to manage a multi-processing system is large in comparison to the overhead requirements of a single-processing environment.